import request from '@/utils/request'

// 查询模具机种信息列表
export function listJzmMstr(query) {
  return request({
    url: '/project/jzmMstr/list',
    method: 'get',
    params: query
  })
}

// 查询模具机种信息详细
export function getJzmMstr(jzmId) {
  return request({
    url: '/project/jzmMstr/' + jzmId,
    method: 'get'
  })
}

// 新增模具机种信息
export function addJzmMstr(data) {
  return request({
    url: '/project/jzmMstr',
    method: 'post',
    data: data
  })
}

// 修改模具机种信息
export function updateJzmMstr(data) {
  return request({
    url: '/project/jzmMstr',
    method: 'put',
    data: data
  })
}

// 删除模具机种信息
export function delJzmMstr(jzmId) {
  return request({
    url: '/project/jzmMstr/' + jzmId,
    method: 'delete'
  })
}

// 导出模具机种信息
export function exportJzmMstr(query) {
  return request({
    url: '/project/jzmMstr/export',
    method: 'get',
    params: query
  })
}

//修改状态
export function changeJtmMstrFlag(jzmId,jzmFlag){

  const data = {
    jzmId,
    jzmFlag
  }
  return request({
    url: '/project/jzmMstr/changeFlag',
    method: 'put',
    data: data
  })
}

export function getAllJzm() {
  return request({
    url: '/project/jzmMstr/listApi',
    method: 'get'
  })
}

export function getJzByCusId(id) {
  return request({
    url: '/project/jzmMstr/getJzByCusId/' + id,
    method: 'get'
  })
}
